<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragma" content="no-cach" /> 
<meta http-equiv="cache-control" content="no-cache" /> 
<meta http-equiv="expires" content="0" />
<title>video</title>
<style>
.bt input,.bt span{
    -webkit-border-radius: 10px;
    border-radius: 10px;
	
}
.bt input,.bt span {
	font-size:16px; 
	filter: alpha(opacity=60); opacity: 0.6;
	box-shadow: 0px 0px 0px #fff;	
	/*border:1px #fff solid;
background-color:#00f;
color:#fff; font-weight:bold;*/
}
.bt input:hover,.bt span:hover {
	box-shadow: 0px 0px 25px #fff;
	font-size:16px; 
	filter: alpha(opacity=90); opacity: 0.9;}
body{margin:0px;
overflow:hidden;
}
.inp{ width:250px; 
        overflow:hidden;


}
li{list-style-type:none;}
#main{
	height:100%;
	width:100%;
	}
</style>
<script src="../inc/jquery-2.0.3.js"></script>
<script src="../inc/doll_1.0.js"></script>
<script>
$(function(){
     window.setTimeout(function(){
 						$('#debug').hide(2000);	
 				 },6000)
				 
	function setprogW(){
	$time_cur=_g('player').currentTime
	$time_dur=_g('player').duration 
		if(!isNaN($time_cur)&&!isNaN($time_dur)){
			$width=Math.floor(($time_cur/ $time_dur )*1920);
			//$('#progress_text').html(  
//				  $width
//			 
//			  +"|"+$time_cur+"|"+$time_dur
//			 
//			 );	
			 $('#progress').css({width:$width+"px"})
			 $('#id_time').html(
			 $.doll.sec2date(Math.floor($time_cur))+"/"
			 +$.doll.sec2date(Math.floor($time_dur))
			 +'<span style="font-size:14px;">'+$.doll.getLocalTime()+'</span>'
			 );	
		}
	}
	window.setInterval(function(){
	 setprogW()
		//$('#progress_text').html(  
//		      $width
//		 
//		  +"|"+$time_cur+"|"+$time_dur
//		 
//		 );	
 
	 
		
	},100)
     var video=$("#player").get(0);
	//$.doll._prof("#de",video);
	 
	$("#pre").click(function(){
	     randplay("pre")      
	})
	$("#next").click(function(){
	     randplay() 
	     //video.src=$arr[window._playid+1];	     
	})
	$("#pause").click(function(){
	 
	     video.pause();	     
	})
 
	$("#play").click(function(){
		 
	     video.play();	     
	})	
	
	$("#volume_").click(function(){
	     video.volume -= 0.1;	 
		 $("#volume").val(parseInt(video.volume*10)/10)           
	})	
	
	$("#volumeP").click(function(){
	     video.volume += 0.1;	
		 $("#volume").val(parseInt(video.volume*10)/10)     
	})
	
	$("#back").click(function(){
	     video.currentTime -= 10;	     
	})	
	
	$("#go").click(function(){
	     video.currentTime += 10;	     
	})	
	
	$("#rate_").click(function(){
	     video.playbackRate -= 0.1;	
		 
		 $("#rate").val(parseInt(video.playbackRate*10)/10)     
	})
	
	$("#rateP").click(function(){
	     video.playbackRate += 0.1;	  
		  $("#rate").val(parseInt(video.playbackRate*10)/10)    
	})
	
 	$("#muted").click(function(){
	     if(video.muted==true){
		    video.muted=false;
		 }else{
			video.muted=true; 
		 }     
	})	
	
	$("#full").click(function(){
		_kd(true);
	    // video.webkitEnterFullscreen();
		// controls=null;
		// video.mozRequestFullscreen();
	})
	$("#progress_click").click(function(){
		$go_time=_g('player').duration*
		$.doll.getMouseScreenPos()[0]/1920;
		//$("#progress_click").html($go_time); 
		
		_g('player').currentTime=$go_time;
		setprogW();
	      
	})
	
	
})
</script>
<script>
$(function(){

	$("#reload").click(function(){
	    window.location.reload() ;	
	})
	$("#reload2").click(function(){
	    window.location.reload() ;	
	})


})
function _n(){
if(window._2_ != "hide"){
     $('.num').hide();
	 window._2_="hide";
  }else{
	  $('.num').show(); 
	  window._2_="show";
  }
}

function __(){
    
	//if(event.keyCode==221 || event.keyCode ==13)
	{_n();}
	_bs("a");
}


</script>
<script>
window.g_src='empty';
window._full=false;
window.timenum=1;
window.onload=function(){
    window.timer_fx= setInterval(function(){ch();_g('player').blur();},2000);	
}
$(function(){
	
      window.setTimeout(
	 function(){
		  
		// $('#fl').get(0).click()
		// $('#debug').hide(3000)
		 
		 } ,3000
	 ) 
	 try{
	console.log("test lob")
	 }catch(e){}
	//console.dir(window.doll)
	var _window=!window.mousemove?window.document:window
	$(_window).on(
		"mousemove",
		function(evt){
			 //try{
				//$.doll.trace("#trace",evt)
				try{
				//console.dir(evt.originalEvent)
				}catch(e){}
				$('#msPage').html(
					$.doll.getMousePagePos().join("<--Page-->")
				)
				$('#msc').html(
					$.doll.getMouseClientPos().join("<-Client->")
				)
				if($.doll.getMouseClientPos()[0]<50)
				{
					$('#debug').css({display:"block"});
				}
				if($.doll.getMouseClientPos()[1]>1000 
				&&$.doll.getMouseClientPos()[0]<100)
				{
					$('#trace').css({display:"block"});
				}
				if($.doll.getMouseScreenPos()[1]>980 
				 )
				{
					$('#id_controls').css({display:"block"});
				}
				
				
			 //}catch(e){/*alert(e)*/}
		} 
	)
 
	 $(_window).on(
		"mousemove",
		function(){
			try{
				$('#msScreen').html(
					$.doll.getMouseScreenPos().join("<-Screen->")
				)	
				}catch(e){/*alert(e)*/}	
				
			if($.doll.getMouseScreenPos()[1]<900			
			){$('#id_controls').css({display:"none"});}
	 		
		} 
	)
	$('#debug').on(
		"mouseout",
		function(){
			try{
				if($.doll.getMouseClientPos()[0]>1180
				
				){
					$('#debug').hide(2000);
				}else{
					//window.setTimeout(function(){
//						$('#debug').hide(2000);	
//					 },6000)
				}
			}catch(e){/*alert(e)*/}
		}
			
    )
	 
		
	$('#trace').on(
		"mouseout",
		function(){
			try{
			if($.doll.getMouseClientPos()[1]<1000){
			    $('#trace').hide(2000);
			}
			}catch(e){/*alert(e)*/}
		}
    )
	
	$('#player').on(
		"click",
		function(){
			try{
			 //  _kd(true) ;
			 
			}catch(e){/*alert(e)*/}
		}
    )
	
})

function _high(ar){
  if(ar!=null){
      return "<span style='color:red;'><b>"+ar+"</b></span>";
  }else{
      return ar;	
  }
}
function ShowObjProperty(Obj) { 
    var PropertyList = ''; 
    for(i in Obj){ 
   //  if(Obj.i != null) {
      PropertyList = PropertyList +'['+ i + ']属性：' + Obj.i + '<br>\r\n'; 
   //  } else {
     PropertyList = PropertyList +'['+ i + '] 方法:'+_high(Obj.getAttribute(i))+'<br>\r\n';} 
	// }
	 return  PropertyList;
}
 


function _g(id){
return window.document.getElementById(id);
}
function sorh(){

	 if(_g("id1").style.display!="block"){
       // _g("id1").style.display="block";
	}else{
		// _g("id1").style.display="none";
	} 
}

function _bs(id){

	 if(_g(id).style.display!="block"){
         _g(id).style.display="block";
	}else{
		  _g(id).style.display="none";
	} 
}
function _gtag(tag){
	return  document.getElementsByTagName(tag);
}

function resets()
{
  var controls = document.getElementsByTagName('input');
  for(var i=0; i<controls.length; i++){
    if(controls[i].type=='button'){
     // controls[i].value='button';
	  //controls[i].v='fadsf';
	 //controls[i].setAttribute("v","vvvvv");
	// alert( controls[i].v);
    }
  }

}


function randplay(target)
{  window.timenum=1;
  var controls = document.getElementsByTagName('input');
  var $arr=new Array();
  var j=0;
  for(var i=0; i<controls.length; i++){
	  
    if(controls[i].type=='button'){
     $arr[j]=controls[i].value;
	 j++;
    }
  }
 
  if(isNaN(window._playid)||window._playid>=$arr.length-1){
	
	 window.$arr=_randarr($arr);
	
	 window._playid=0;
	 _g('playid').innerHTML="init:"+($arr.length-1)+"|"+window._playid;
	
	  }else{
		
		window.__playid=window._playid;
		if( !($('input:radio:checked').val()==="re") 
		
		){
			if(target!=="pre"){
		window._playid=window._playid+1; 
			}
		} 
		_g('playid').innerHTML=($arr.length-1)+"|"+window._playid;
		 
	}
	
	// $.doll._prof("#debug",$arr);
 
	var __src=$arr[window._playid];
try{
	
	 
  if(target==="pre"){
	  //alert($("#presrc").html());
	  window._playid=window._playid-1; 
		 _g('player').src=""+$("#presrc").html();
		}else{
		 
	 _g('player').src=$arr[window._playid];
		}
  _g('player').play();
}catch(e){
	 
	 $.doll.trace("#tracea",
				{error:"对象不支持该属性和方法"+e+" "+Math.random()}
				)
	}
  $.doll.trace("#trace",
				{_trace:"当前播放："+__src+" "+Math.random()}
				)
	try{
		/*$arrs=$('#debug div').get();
		$a10=$('#debug div');
	    for(i=0;i<$arrs.length;i++){
	    $('#debug').get(0).removeChild( $a10.get(i) );
		
		
		}*/
		//$.doll.removeChild( 
		//    $('#debug').get(0),$('#debug div').get()
		//)
		$.doll.removeChild( 
		    $('#debug div').get()
		)
	}catch(e){alert(e)}
	$arrResult=new Array();
	$arrResult["arrLength"]=$arr.length;
	$arrResult["playsrc"]=__src;
	$arrResult["playid"] =window._playid;
	$arrResult[parseInt(0+window._playid)+"Current"]=
	$arr[parseInt(0+window._playid)];
	
	$arrResult[parseInt(1+window._playid)+"Next"]=
	$arr[parseInt(1+window._playid)];
	
	$arrResult[parseInt(2+window._playid)]=
	$arr[parseInt(2+window._playid)];
	  $.doll._prof("#debug",
		  $arrResult
	);

   
 
	  $('#up').get(0).innerHTML=(window._playid-2)+":"+ $arr[window._playid-2] +"<br>[" 
								  +(window._playid-1)+"]<:" +'<span id="_up">'+$arr[window._playid-1]+
								  "</span>"  +"<br>" 
								   +(window._playid )+"Current:<b><span style='color:#0f0;'>"+ $arr[window._playid ]  +"</span></b><br>" 
								  +(window._playid+1)+">:"+ $arr[window._playid+1] +"<br>"  
								  +(window._playid+2)+":"+ $arr[window._playid+2]  +"<br>" ;
		   
		$('#presrc').get(0).innerHTML  = $arr[window._playid-1];
		  
}

function _rand(max,min){
    return Math.round(  Math.random()*(max - min) + min  );
}
</script>
</head>

<body  style="  " onKeyUp="_kd();">
<div id="debug" style="top: 0px;position:fixed; height:800px; width:1200px; left:0px; z-index:99; background-color:#06F;filter: alpha(opacity=60); opacity: 0.6; color:#fff; display: block;

">双击视频可以播放下一视频
<input name="" id="reload" type="reset" value="reload">
<input name="" type="reset"  value="randplay()" onClick="randplay();" >
<input name="" type="reset" id="fl"  value="_kd(true)" onClick="_kd(true);" >

</br>
<span id="msPage">ms</span></br> 
<span id="msScreen">msScreen</span></br>
<span id="msc">msClient</span></br>
</div>
<div id="trace" style="display:block; position:fixed; bottom:0px; width:100%; height:100px;color:#fff; background-color:#000;filter: alpha(opacity=60); opacity: 0.6;z-index:100; ">trace:

</div>
<span id="tracea" style="z-index:101; background-color:red; color:#fff;"></span>
<div style="height:0px; background-color:#fff; width:100%; border:none; position: relative; float:right; clear:both;" id="idtop"></div>
<table width="100%" height="98%" border="0" cellspacing="0" cellpadding="0" style="margin:0px;" >

  <tr>
    <td >
 

<div style=" position: relative; display:block; width:300px; height:1000px; float:left; overflow-x: hidden;overflow-y:scroll;  "  id="id1">

<input name="" type="reset" value="BESTie - 恋爱的条件" onClick="_g('player').src='[DownMV.com]BESTie - 恋爱的条件_min.mp4';" class="inp">
<input name="" type="reset" value="ot" onClick="_g('player').src='1.mp4';resets();" class="inp">
<input name="" type="button" value="%23P_0019_[120229] T-ara - Roly Poly (日文版.) BS Japan-MADE IN BS JAPAN[60帧].mp4" onClick="_g('player').src='../../VPLIST/%23P_0019_[120229] T-ara - Roly Poly (日文版.) BS Japan-MADE IN BS JAPAN[60帧].mp4';"  class="inp"> 
 <input name="" type="reset" value="_bs(id)" onClick="_bs('info')" class="inp" style="float:left; width:80px; overflow:hidden; margin-right:10px;">
  <input name="" type="reset" value="_index.html" onClick="window.open('_index.html?a='+Math.random());" class="inp" style="float:left; width:80px; overflow:hidden;margin-right:10px;">
   <input name="" type="reset"  value="更新缓存" onClick="window.open('auto.php?do=do');" class="inp" style="float:left; width:80px; overflow:hidden;margin-right:10px;clear:right;">
     <input name="" type="reset"  value="randplay()" onClick="randplay();" class="inp" style="float:left; width:80px; overflow:hidden;margin-right:10px;clear:right;">
     <span id='playid'>playid</span><br>
  按pgUp全屏，按pgDn切换视频,可能只支持谷哥浏览器<br>
  <input name="" type="reset"  value="__()" onClick="__();" class="inp" style="float:left; width:80px; overflow:hidden;margin-right:10px;clear:right;">  
  <input name="" id="idfull" type="reset"  value="$.doll.fullscreen( )" onClick="$.doll.fullscreen( );" class="inp"> 
  ;
   <input name="" type="reset"  value="$.doll.exitFullscreen( )" onClick="$.doll.exitFullscreen( );" class="inp"> 
   <input name="" type="reset"  value="_kd(true)" onClick="_kd(true);" >
<?php
require_once('../inc.php');
echo date('Y-m-d h:i:s',time());
?>

<?php 
function _videoname($arr){
	$retarr=array();
	foreach($arr as $key => $val){
	//$str	=	preg_replace(        "/\.\.[\/\\\]{1,}/","",                           iconv('GB2312','UTF-8', $val)                 );
	$str              =   iconv('GB2312','UTF-8', $val)  ;
	$str              = preg_replace("/#/","%23",$str);
	 if(preg_match("/\.mp4/i",$str)!=0){
		 if(preg_match("/\.del\./i",$str)==0){
	    $retarr[$key] =   $str ;
		 }
	  }
	}
	return $retarr;
}
function _arr_fill_input($arr){
	$retarr=array();
	foreach($arr as $key => $val){
        $str="<input name='' type='button'  ";
       // $str=$str."value=\"".preg_replace( array("/\.\.[\/\\\]{1,}/","/VPLIST/"),"", $val)."\" onClick=\"_g('player').src='".$val."';_g('info').innerHTML=(this.value)\"  ";
	 $str=$str."value=\"".$val."\" onClick=\"_g('player').src='".$val."';_g('info').innerHTML=window.g_src=(this.value)\"  ";
        $str=$str."class='inp'     >" ;
		$retarr[$key]=$str;
	}	
	return $retarr;
}
$filenames1= _videoname(  glob("../../VPLIST/*.mp4"))  ;
$filenames= array_merge(_videoname(  glob("../../VPLIST_MIN/*.mp4")) , $filenames1  ) ;

//secho(_arr_fill_input($filenames));
//echo _print_tree(_arr_fill_input($filenames));
 shuffle($filenames);
_array_fill_table( _arr_fill_input($filenames) );
?>
</div>
</td>
<td>
<div      id="info" style=" overflow-y: scroll; overflow-x: hidden; height:80px; display:none;">444</div>
<div style="width:100%; float: left; position:relative; margin-top:0px; margin-left:0px;">
<video  src="1.mp4" controls="controls" autoplay="autoplay"  width="100%" id="player" onKeyDown="_kd();" onclick="change_controls()" onDblClick="randplay();	"   style="ime-mode:disabled;"  >
your browser does not support the video tag
</video>
</div>
</center>

<script>
function change_controls(){
   if(_g('player').controls==false){
		_g('player').controls=true;
	}else{
	  //  _g('player').controls=false;
	}
}
function ch(){

    
    var str="duration:"+_g('player').duration+"|currentTime:"+_high(_g('player').currentTime)+"|ended:"+_g('player').ended;
str=str+'<br>'+window.g_src+'<br>';
	str=str+"<br>currentSrc:"+_g('player').currentSrc+'<br>';
	str=str+"playbackRate:"+_high(_g('player').playbackRate)+'<br>';
	str=str+_high(Math.abs(   _g('player').duration-_g('player').currentTime ));
	 _g('info').innerHTML=str+ShowObjProperty(_g('player')) ;
	 var num=Math.abs( _g('player').duration-_g('player').currentTime );
	//alert(NaN-200<200);
	
	     if(num<4 ){	 
		     if(window.timenum==1){
				 //window.timenum判断randplay()是不已经执行
				 //window.timenum为2时将不再执行;
	             window.time_fx2=window.setTimeout(function(){ randplay();},4000);	
				 window.timenum=2;
			  }
		    }
			if(isNaN(num)){
				$.doll.trace("#trace",
				{_trace:"Error:_g('player').duration-_g('player').currentTime=num 为 NaN "+Math.random()}
				)
			 //  $.doll._prof("#debug",{err:"_g('player').duration-_g('player').currentTime=num 为 NaN"})
			/* $.doll.removeChild( 
		      $('#trace div').get()
		    )
		    $.doll._prof( 
		      '#trace',{trace:"Error:_g('player').duration-_g('player').currentTime=num 为 NaN "+Math.random()}
		    )
			$('#trace').css({display:"block"})
				window.setTimeout(function(){
				   // $('#trace').css({display:"none"})
				},5000
			)*/
			 //deplaysrc()
			 window.setTimeout(function(){
				 if(window._lock!=true)
				 window._lock=true
				 randplay()
				 },0
				 )
			}
		if(_g('player').currentSrc=='undefined'){
			$.doll.trace("#trace",
				{_trace:"Error:_g('player').currentSrc=='undefined' "+Math.random()}
				)
				
				 window.setTimeout(function(){
				 if(window._lock2!=true)
				 window._lock2=true
				 randplay()
				 },0
				 )
			//deplaysrc()
			
		}

}
function deplaysrc(){
	_g('player').src="1.mp4";
	_g('player').play();
}
window.setTimeout(function(){randplay();},2000);

function _randarr(arr){
    var arrax=new Array();
	var len=arr.length;
    for($i=0;$i<len;$i++){ 
        var ele=arr.splice(  _rand(arr.length-1,0) ,1    );
		 
        arrax[$i]=ele[0];
    }
	return arrax;
}
function _kd(bl){
	//alert(event.keyCode);
	if(typeof bl=="undefined"){bl=false;}
  var condition2=false;
	 	 try{
		  condition2=event.keyCode==13||event.keyCode==34　;}catch(e){}
 	 try{ 
	 if(condition2){
   randplay();	
  _g('player').controls=null;
  _g('player').removeAttribute('controls');
	 }}catch(e){}
	    
	 
		 var condition=false;
		 try{
		  condition=event.keyCode==33　;}catch(e){
         } 
  
	  if(condition||bl){
 
		  // alert(window._full?"full":"exitfull");
	 	  
		  if(_g('id1').style.width!='0px'){
			  window._full=true;
			  try{
				 // $("#idfull").click()
			   $.doll.fullscreen(
			    document.documentElement
			   );
			  }catch(e){alert(e)}
	 	   _g('player').style.width='1920px';  
		    _g('id1').style.display='none';
		    _g('id1').style.width='0px';  
		    _g('idtop').style.backgroundColor='#000';
		    _g('id1').style.overflow='hidden';
		 //      
			 
			 
			 
		  }else{
		 
		  window.setTimeout(function(){
			   
			    $.doll.exitFullscreen();
			  window._full=false;
			  _g('player').style.width='100%';  
			  _g('id1').style.display='block';  
			  _g('id1').style.width='300px';
			  _g('idtop').style.backgroundColor='#fff';
			   _g('id1').style.overflowY='scroll';
	 //
				  
				  
			 
		      },0
			 )
		  }
	   
	  }
   
   
   
   
}

 
</script>
</td>
</table>
<div id="id_controls" style="position:fixed; bottom:0px; display:none; margin:0px auto; width:1920px; border:0px #fff solid; filter: alpha(opacity=70); opacity: 0.7;z-index:101; background-color:#000; height:100px; color:#ffffff; overflow: hidden;">
<div class="bt" style="padding:0px  0px; z-index:10; ">
    
    <div id="progress" style="height:100px; background-color:#500389; width:100px; position:fixed; bottom:0px; z-index:20; ">
    <div id="progress_click" class="bt" style="height:100px; background-color:#F90;filter: alpha(opacity=10); opacity: 0;  width:1920px; position:fixed; bottom:0px; z-index:-1;  ">
    
    </div>
    <center> 
    <div id="progress_click" class="bt" style="   filter: alpha(opacity=10); opacity: 10;  position:fixed; bottom:20px; z-index:50; width:1920px; padding:0px auto;  ">
        <div  style="  width:1050px;  ">
        <span>重复：</span>
         <input name="repeat" type="radio" value="" checked="checked"><span>无</span> 
         <input name="repeat" type="radio" value="re"  ><span>单曲重复</span>
        <input name="" type="button" id="pre" value="<" >
        <input name="" type="button" id="next" value=">" >
        <input name="" type="button" id="pause" value="pause">
        <input name="" type="button" id="play" value="play">
        <input name="" type="button" id="go" value="go">
        <input name="" type="button" id="back" value="back">
        <input name="" type="button" id="rate_" value="rate-">
        
        <input name="" type="button" id="rateP" value="rate+">
        <input name="" type="button" id="volume_" value="volume-">
        <input name="" type="button" id="volumeP" value="volume+">
        <input name="" type="button" id="muted" value="muted">
        <input name="" type="button" id="full" value="full">
        <input name="" type="button" id="rate" value="1.0">
        <input name="" type="button" id="volume" value="1.0">
          <input name="" type="button" id="reload2" value="R">
        </div>
    </div></center>
    <div id="id_time" style="  position:fixed; z-index:1;  overflow:hidden;filter: alpha(opacity=70); opacity: 0.7; bottom: 0px; left:20px; font-size:36px; font-family: Consolas,Source Code Pro; "> 
 
</div>
   <div id="progress_text" >
  
   </div>
  </div>
 <br><span id="presrc" style="color:red;display:none;">presrc</span>
<br>
<span id="up" style="display:none;">up</span>
 </div> 
 

</div>

<div style="background-color:green; position:fixed; z-index:1; width:1920px; height:1080px; overflow:hidden;filter: alpha(opacity=0); opacity: 0; top: 0px; left:300px;">
hgfdgfdhgfhgfhdghf
</div>
<iframe src="auto.php" style="display:none;  "></iframe>
</body>
</html>